package demo6;

public class Test {
    public static void main(String[] args) {
        Object object1 = new People("小明",18,224);
        Object object2 = new People("小明",18,224);
        System.out.println(object1.hashCode());
        System.out.println(object2.hashCode());
    }
    public static void main4(String[] args) {
        Object obj1 = new Student("小华",18,20245);
        Object obj2 = new Student("小华",18,20245);
        System.out.println(obj1 == obj2);//false
        System.out.println(obj1.equals(obj2));//false->true(重写equals方法后)
    }
    public static void main3(String[] args) {
        int a = 10;
        int b = 10;
        System.out.println(a == b);
        System.out.println("=========");
        int c = 20;
        int d = 30;
        System.out.println(c == d);
    }
    public static void main2(String[] args) {
        Object object = new People("小明",18,20241645);
        System.out.println(object.toString());
    }
    public static void print(Object obj) {
        System.out.println(obj.toString());
    }
    public static void main1(String[] args) {
        People people = new People("小明",18,20241645);
        //Student student = new Student();

        print(people);
        //print(student);
    }
}
